#ifndef __RM_USERAPP_H__
#define __RM_USERAPP_H__

#include "key.h"
#include "Ranging_C.h"
#include "Flash.h"
#include "Back_App.h"

#define MODE_ON           0
#define MODE_OFF          1

#define MODE_1            1
#define MODE_2            2

#define MODE_1_1          1
#define MODE_1_2          2
#define MODE_1_3          3


#define MODE_SET_1          1
#define MODE_SET_2          2
#define MODE_SET_3          3

#define MODE_SET_1        1
#define MODE_SET_2        2
#define MODE_SET_3        3

#define DIS_DELAY       40
#define DIS_QJ          10999

typedef struct
{
	uint8_t Mode;
	uint8_t Mode_SET;
	uint8_t Mode_SET_L123;	
	uint8_t Mode_SET_NEXT;	
	uint8_t Mode_1_2;		
	uint8_t Mode_Set;
	uint8_t Mode_ONOFF;	
	uint8_t Unit;
	uint8_t Rang;
	uint8_t Contin;
	uint8_t Contin_T;	
	uint8_t S_z;
	uint8_t S_r;
	uint8_t S_dist_qh;	
	uint8_t S_dist_st;	
	uint8_t Q_st;	
	uint8_t S_zr_st;	
	uint8_t S_zr_st_D_S2;
	uint8_t S_zr_st_D_S3;	
	uint8_t S_cl_time;	
	uint8_t S_cl_flag;
	uint8_t S_zr_time;	
	uint8_t S_zr_time_st;	
	uint16_t Dist_val;
	uint16_t Dist_val_Old;	
	float Dist_val_x;
	uint16_t Dist_val_AB;
	short int Dist_val_AB_JD;	
	uint16_t Dist_M_Slope;	
	uint16_t st;
	uint16_t st_cnt;	
	uint16_t st_T;
	uint16_t st_cnt_T;	
	uint16_t Dist_E_Slope;		
	uint8_t M2_Set;	
	float ImuPitch_Temp;
	short int ImuPitch_disp;	
	short int YAW_disp;		
	short int ImuPitch_disp_Old;	
	uint8_t Rang_Next;
	uint8_t Init_flag;
	uint8_t ST_Z;	
	uint8_t ST_k;	
	uint8_t BUZZER;
	uint16_t wt;	
}_User_par;

extern _User_par User_par;
	

void User_App(void);
void UI_Glint(void);

void Mode_UI_SET_2(void);


#endif
